package com.sc.VenusQueryBeta.model.home.tabs;

import com.hengjun.kingstar.sdk.base.BaseModel;
import com.hengjun.kingstar.sdk.helper.RetrofitCreateHelper;
import com.hengjun.kingstar.sdk.helper.RxHelper;
import com.sc.VenusQueryBeta.api.Host;
import com.sc.VenusQueryBeta.api.home.HomeApi;
import com.sc.VenusQueryBeta.contract.home.tabs.ZhiXunContract;
import com.sc.VenusQueryBeta.model.bean.home.HomeBannerBean;
import com.sc.VenusQueryBeta.model.bean.home.HomeNoticeBean;
import com.sc.VenusQueryBeta.model.bean.home.HostListBean;

import io.reactivex.Observable;

/**
 * Created by SC-02 on 2018/9/19.
 *最新资讯模型
 */

public class ZhiXunModel extends BaseModel implements ZhiXunContract.IZhiXunModel {

    public static ZhiXunModel newInstance() {
        return new ZhiXunModel();
    }


    /**
     *获取首页banner
     */
    @Override
    public Observable<HomeBannerBean> getHomeBanner() {
        return RetrofitCreateHelper.createApi(HomeApi.class, Host.Host).getBanner().compose(RxHelper.<HomeBannerBean>rxSchedulerHelper());
    }

    /**
     *获取首页公告
     */
    @Override
    public Observable<HomeNoticeBean> getHomeNotice() {
        return RetrofitCreateHelper.createApi(HomeApi.class, Host.Host).getHomeNotice().compose(RxHelper.<HomeNoticeBean>rxSchedulerHelper());
    }

    /**
     *获取首页热门活动列表
     */
    @Override
    public Observable<HostListBean> getHomeHotList() {
        return RetrofitCreateHelper.createApi(HomeApi.class, Host.Host).getHotActivityList().compose(RxHelper.<HostListBean>rxSchedulerHelper());

    }

    @Override
    public Observable<Boolean> recordItemIsRead(String key) {
        return null;
    }
}
